package com.HomeWorkhsp.Chapter07;

/**
 * Enjoy programming!!!
 * Time: 2021/11/8 -  21:05
 */
public class Test01 {
    public static void main(String[] args){
        A02  a02 = new A02();
        String[] a = {"hello","world!"};
        int n = a02.find("hello",a);
        System.out.println(n);
    }
}
class A02{
    int res = -1;
    public int find(String c, String[] a){
        for (int i = 0; i < a.length; i++){
            if (c == a[i]){
                res = i;
            }
        }
        return res;
    }
}
